package
{
	import flash.display.Sprite;
	import flash.events.Event;

	/**
	 * ...
	 * @author Lighter
	 */
	[Frame(factoryClass = "Preloader")]
	[SWF(width="800",height="600",frameRate="60")]
	public class Main extends Sprite 
	{
		private var demo:Demo;
		
		public function Main() 
		{
			if (stage) init();
			else addEventListener(Event.ADDED_TO_STAGE, init);
		}

		private function init(e:Event = null):void 
		{
			removeEventListener(Event.ADDED_TO_STAGE, init);
			// entry point
			var url:String = "../../Demo/assets";
			if (stage.loaderInfo.parameters.hasOwnProperty("assets")) {
				url = stage.loaderInfo.parameters["assets"];
			}
			demo = new Demo(this,url);
		}
	}
}